cmake_minimum_required(VERSION 3.16)

project(SnapyPairs VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 REQUIRED COMPONENTS Quick Multimedia)

qt_standard_project_setup(REQUIRES 6.5)

qt_add_executable(appSnapyPairs
    main.cpp
)

qt_add_qml_module(appSnapyPairs
    URI SnapyPairs
    VERSION 1.0
    QML_FILES
        Main.qml
        RESOURCES media/images/audioOff.png media/images/audioOn.png media/images/musicOff.png media/images/musicOn.png
        RESOURCES media/images/return.png
        RESOURCES media/images/card6.png
        RESOURCES media/images/card0.png
        RESOURCES media/music/Puzzle-Game-2.ogg
        RESOURCES media/sounds/cardSlide1.ogg
        RESOURCES media/sounds/cardPlace1.ogg
        QML_FILES Card.qml
        SOURCES gamestate.h gamestate.cpp
        RESOURCES media/images/card1.png media/images/card2.png media/images/card3.png media/images/card4.png media/images/card5.png media/images/card7.png media/images/card8.png media/images/card9.png media/images/card10.png media/images/card11.png media/images/card12.png media/images/card13.png media/images/card14.png media/images/card15.png media/images/card16.png media/images/card17.png media/images/card18.png media/images/card19.png media/images/card20.png media/images/card21.png
        QML_FILES Menu.qml
        QML_FILES Game.qml
        RESOURCES media/uts/shadow.png
)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(appSnapyPairs PROPERTIES
#    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appSnapyPairs
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(appSnapyPairs
    PRIVATE Qt6::Quick
)

include(GNUInstallDirs)
install(TARGETS appSnapyPairs
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
